#include <graphics/indexbuffer.h>
#include <graphics/utils.h>
#include <QtOpenGL>

namespace yam3d
{
namespace graphics
{

IndexBuffer::IndexBuffer( const core::vector<unsigned int>& indices)
    : m_indices(indices)
{
}

IndexBuffer::~IndexBuffer()
{
}

void IndexBuffer::draw()
{
    glDrawElements ( GL_TRIANGLES, m_indices.size(), GL_UNSIGNED_INT, m_indices.constData() );
    checkGlError("glDrawElements");
}

}
}

